package com.ruoyi.spicfz.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.spicfz.domain.ExecutivesCompos;
import com.ruoyi.spicfz.mapper.ExecutivesComposMapper;
import com.ruoyi.spicfz.service.IExecutivesComposService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 高管任职Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-09-02
 */
@Service
public class ExecutivesComposServiceImpl implements IExecutivesComposService 
{
    @Autowired
    private ExecutivesComposMapper executivesComposMapper;

    /**
     * 查询高管任职
     * 
     * @param executiveId 高管任职ID
     * @return 高管任职
     */
    @Override
    public ExecutivesCompos selectExecutivesComposById(Long executiveId)
    {
        return executivesComposMapper.selectExecutivesComposById(executiveId);
    }

    /**
     * 查询高管任职列表
     * 
     * @param executivesCompos 高管任职
     * @return 高管任职
     */
    @Override
    public List<ExecutivesCompos> selectExecutivesComposList(ExecutivesCompos executivesCompos)
    {
        return executivesComposMapper.selectExecutivesComposList(executivesCompos);
    }

    /**
     * 新增高管任职
     * 
     * @param executivesCompos 高管任职
     * @return 结果
     */
    @Override
    public int insertExecutivesCompos(ExecutivesCompos executivesCompos)
    {
        executivesCompos.setCreateTime(DateUtils.getNowDate());
        return executivesComposMapper.insertExecutivesCompos(executivesCompos);
    }

    /**
     * 修改高管任职
     * 
     * @param executivesCompos 高管任职
     * @return 结果
     */
    @Override
    public int updateExecutivesCompos(ExecutivesCompos executivesCompos)
    {
        executivesCompos.setUpdateTime(DateUtils.getNowDate());
        return executivesComposMapper.updateExecutivesCompos(executivesCompos);
    }

    /**
     * 删除高管任职对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteExecutivesComposByIds(String ids)
    {
        return executivesComposMapper.deleteExecutivesComposByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除高管任职信息
     * 
     * @param executiveId 高管任职ID
     * @return 结果
     */
    @Override
    public int deleteExecutivesComposById(Long executiveId)
    {
        return executivesComposMapper.deleteExecutivesComposById(executiveId);
    }
}
